import {createRouter, createWebHashHistory} from 'vue-router';

// 本地静态路由
export const constantRoutes = [
    {
        path: '/',
        component: () => import('@/views/dashboard/index.vue'),
        meta: {
            breadcrumbItemList: ["首页"],
        },
    },
    {
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        meta: {
            isParentView: true,
        },
    },
    {
        path: '/lstm',
        component: () => import('@/views/lstm/index.vue'),
        meta: {
            breadcrumbItemList: ["LSTM预测"],
        },
    },
    {
        path: '/sentiment_analysis',
        component: () => import('@/views/sentiment_analysis/index.vue'),
        meta: {
            breadcrumbItemList: ["情绪分析预测"],
        },
    },
    {
        path: '/srl',
        component: () => import('@/views/srl/index.vue'),
        meta: {
            breadcrumbItemList: ["语义分析预测"],
        },
    },
    {
        path: '/comprehensive',
        component: () => import('@/views/comprehensive/index.vue'),
        meta: {
            breadcrumbItemList: ["综合预测"],
        },
    },
    // {
    //     path: '/test',
    //     component: () => import('@/views/test/index.vue'),
    // },
    {
        // path: '/404',
        path: '/:pathMatch(.*)*', // 防止浏览器刷新时路由未找到警告提示: vue-router.mjs:35 [Vue Router warn]: No match found for location with path "/xxx"
        component: () => import('@/views/error-page/404.vue'),
    },
];

// 创建路由
const router = createRouter({
    history: createWebHashHistory(),
    routes: constantRoutes,
});

export default router;
